package TestBuffered;

import java.io.*;

public class TestBufferedInputStream {
    public static void main(String[] args) throws IOException {
        InputStream in=null;
        BufferedInputStream bf=null;
        try {
            String path="F:\\123.txt";
            in=new FileInputStream(path);
            bf=new BufferedInputStream(in);
            byte[] bytes=new byte[1024];
            int i;
            while ((i=in.read(bytes)) != -1){
                String s=new String(bytes,0,i);
                System.out.println(s);
            }


        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (bf!=null) bf.close();
        }
    }
}
